package com.hong.demo.springboot.es.controller;

import com.hong.demo.springboot.es.entity.mysql.MySQLBlog;
import com.hong.demo.springboot.es.repository.mysql.MySQLBlogRepository;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.GetMapping;

import java.util.List;

@Controller
public class IndexController {

    @Autowired
    MySQLBlogRepository mySQLBlogRepository;

    @GetMapping("/")
    public String index(){
        List<MySQLBlog> all = mySQLBlogRepository.findAll();
        System.out.println(all.size());
        return "index.html";
    }
}
